package Controller;

import Model.Qiandao;
import Service.QiandaoService;
import utils.ReturnData;
import utils.ReturnDataForLayui;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 分类控制层
 */
@Controller
@RequestMapping("/qiandao")
public class QiandaoController{

    @Autowired
    private QiandaoService qiandaoService;

    @RequestMapping("/listPage")
    public String listPage(){
        return "SmartCheck/qiandao/list";
    }

    @RequestMapping("/alarmlistPage")
    public String alarmlistPage(){
        return "SmartCheck/qiandao/alarmlist";
    }


    @RequestMapping("/getList")
    @ResponseBody
    public ReturnDataForLayui getList(Qiandao qiandao){
        return qiandaoService.getList(qiandao);
    }

    @RequestMapping("/getAlarmList")
    @ResponseBody
    public ReturnDataForLayui getAlarmList(Qiandao qiandao){
        return qiandaoService.getAlarmList(qiandao);
    }

    @RequestMapping("/addPage")
    public String addPage(){
        return "SmartCheck/qiandao/add";
    }

    @RequestMapping("/add")
    @ResponseBody
    public ReturnData add(Qiandao qiandao){
        return qiandaoService.add(qiandao);
    }

    @RequestMapping("/editPage")
    public String editPage(){
        return "SmartCheck/qiandao/edit";
    }

    @RequestMapping("/update")
    @ResponseBody
    public ReturnData update(Qiandao qiandao){
        return qiandaoService.update(qiandao);
    }

    @RequestMapping("/updateState")
    @ResponseBody
    public ReturnData updateState(Qiandao qiandao){
        return qiandaoService.updateState(qiandao);
    }

    @RequestMapping("/delete")
    @ResponseBody
    public ReturnData delete(Qiandao qiandao){
        return qiandaoService.delete(qiandao);
    }

}
